<template>
	<view class="container-accountSetting">
		<view class="lang-top">
			<view class="backIcon" @click="back()">
				<uni-icons type="left" size="26"></uni-icons>
			</view>
			<view class="langText">
				{{$t('账号设定')}}
			</view>
			<view class="clearView">
				
			</view>
		</view>
		<view class="content-view">
			<uni-list>
				<uni-list-item v-if="user.is_auth == 0" :title="$t('信息认证')" link to="/pages/index/searchVerify" :rightText="$t('去认证')"></uni-list-item>
				<uni-list-item v-if="user.is_auth == 1" :title="$t('信息认证')" link :rightText="$t('已认证')"></uni-list-item>
				<uni-list-item :title="$t('钱包管理')" link to="/pages/my/purseManagement"></uni-list-item>
				<uni-list-item :title="$t('语言偏好')" link to="/pages/lang/lang"></uni-list-item>
				<uni-list-item :title="$t('修改登录密码')" link to="/pages/my/changetheloginpwd"></uni-list-item>
				<uni-list-item :title="$t('修改支付密码')" link to="/pages/my/changethepaypwd"></uni-list-item>
				<uni-list-item :title="$t('用户协议')" link to="/pages/index/agreement"></uni-list-item>
				<uni-list-item :title="$t('隐私策略')" link to="/pages/index/privacy"></uni-list-item>
			</uni-list>
		</view>
		<view class="login-btn" @click="loginOut">
			<p>{{$t('退出当前账户')}}</p>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				user:{}
			}
		},
		onShow() {
			this.getinfo()
		},
		methods:{
			back(){
				uni.switchTab({
					url:'/pages/my/index'
				})
			},
			getinfo(){
				this.$http.get(
					'api/user/index',//接口名
					{},//参数合集
					{},
					false
				).then(res=>{
					this.user = res.data
				},(err)=>{//失败的操作
					uni.showToast({
						icon: 'error',
						title: err.data.message
					});
				})
			},
			loginOut(){
				uni.setStorageSync('token',null)
				uni.reLaunch({
				    url: "/pages/login/login"
				});
				// uni.switchTab({
				// 	url:'/pages/index/index'
				// })
			}
		}
	}
</script>

<style scoped>
	.login-btn{
		height: 90rpx;
		line-height: 90rpx;
		font-size: 32rpx;
		width: 90%;
		background: linear-gradient(90deg, #e4392e, #ff4d16);
		border-radius: 46rpx;
		color: #fff;
		text-align: center;
		margin: 78rpx auto 0 auto;
	}
	.container-accountSetting{
		background-color: #f6f6f6;
	}
	.lang-top{
		display: flex;
		padding-left:10rpx;
		height:88rpx;
		line-height:88rpx;
		background-color: #fff;
	}
	.backIcon{
		width:20%;
	}
	.langText{
		font-size:36rpx;
		width:60%;
		text-align: center;
		
	}
	.clearView{
		width:20%;
	}
	.content-view{
		background: #fff;
		margin:10px 0;
		font-size:24rpx;
		
	}
	/deep/.uni-list-item{
		height:50px;
		line-height: 50px;
		font-size:32rpx;
		font-weight: 700;
	}
</style>